package com.ganjingcun.roma.web;

import com.ganjingcun.roma.persist.dao.PlaceDao;
import com.ganjingcun.roma.persist.model.Place;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by GanJc on 2016/4/16.
 */
@Controller
@RequestMapping("/upload")
public class UploadController {

    @RequestMapping(value = "",method = RequestMethod.POST)
    public String toPage(String name ,String desc ,String content) {
        System.out.println(content);
        Place place = new Place();
        place.setPlaceName(name);
        place.setShortContent(desc);
        place.setContent(content);
        PlaceDao placeDao = new PlaceDao();
        placeDao.insertPlace(place);
        return "page";
    }


}
